Optimal. Leaf size=54 \[ \frac {3}{8} \tanh ^{-1}(\sin (x)) \cos (x) \sqrt {a \sec ^2(x)}-\frac {3}{8} \sqrt {a \sec ^2(x)} \tan (x)+\frac {1}{4} \sqrt {a \sec ^2(x)} \tan ^3(x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 54, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {3738, 4210,
2691, 3855} \begin {gather*} \frac {1}{4} \tan ^3(x) \sqrt {a \sec ^2(x)}-\frac {3}{8} \tan (x) \sqrt {a \sec ^2(x)}+\frac {3}{8} \cos (x) \sqrt {a \sec ^2(x)} \tanh ^{-1}(\sin (x)) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2691
Rule 3738
Rule 3855
Rule 4210
Rubi steps
\begin {align*} \int \tan ^4(x) \sqrt {a+a \tan ^2(x)} \, dx &=\int \sqrt {a \sec ^2(x)} \tan ^4(x) \, dx\\ &=\left (\cos (x) \sqrt {a \sec ^2(x)}\right ) \int \sec (x) \tan ^4(x) \, dx\\ &=\frac {1}{4} \sqrt {a \sec ^2(x)} \tan ^3(x)-\frac {1}{4} \left (3 \cos (x) \sqrt {a \sec ^2(x)}\right ) \int \sec (x) \tan ^2(x) \, dx\\ &=-\frac {3}{8} \sqrt {a \sec ^2(x)} \tan (x)+\frac {1}{4} \sqrt {a \sec ^2(x)} \tan ^3(x)+\frac {1}{8} \left (3 \cos (x) \sqrt {a \sec ^2(x)}\right ) \int \sec (x) \, dx\\ &=\frac {3}{8} \tanh ^{-1}(\sin (x)) \cos (x) \sqrt {a \sec ^2(x)}-\frac {3}{8} \sqrt {a \sec ^2(x)} \tan (x)+\frac {1}{4} \sqrt {a \sec ^2(x)} \tan ^3(x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.06, size = 32, normalized size = 0.59 \begin {gather*} \frac {1}{8} \sqrt {a \sec ^2(x)} \left (3 \tanh ^{-1}(\sin (x)) \cos (x)-3 \tan (x)+2 \tan ^3(x)\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 56, normalized size = 1.04
method | result | size |
derivativedivides | \(\frac {\tan \left (x \right ) \left (a +a \left (\tan ^{2}\left (x \right )\right )\right )^{\frac {3}{2}}}{4 a}-\frac {5 \sqrt {a +a \left (\tan ^{2}\left (x \right )\right )}\, \tan \left (x \right )}{8}+\frac {3 \sqrt {a}\, \ln \left (\sqrt {a}\, \tan \left (x \right )+\sqrt {a +a \left (\tan ^{2}\left (x \right )\right )}\right )}{8}\) | \(56\) |
default | \(\frac {\tan \left (x \right ) \left (a +a \left (\tan ^{2}\left (x \right )\right )\right )^{\frac {3}{2}}}{4 a}-\frac {5 \sqrt {a +a \left (\tan ^{2}\left (x \right )\right )}\, \tan \left (x \right )}{8}+\frac {3 \sqrt {a}\, \ln \left (\sqrt {a}\, \tan \left (x \right )+\sqrt {a +a \left (\tan ^{2}\left (x \right )\right )}\right )}{8}\) | \(56\) |
risch | \(\frac {i \sqrt {\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \left (5 \,{\mathrm e}^{6 i x}-3 \,{\mathrm e}^{4 i x}+3 \,{\mathrm e}^{2 i x}-5\right )}{4 \left ({\mathrm e}^{2 i x}+1\right )^{3}}-\frac {3 \sqrt {\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \ln \left ({\mathrm e}^{i x}-i\right ) \cos \left (x \right )}{4}+\frac {3 \sqrt {\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \ln \left ({\mathrm e}^{i x}+i\right ) \cos \left (x \right )}{4}\) | \(117\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 860 vs.
\(2 (42) = 84\).
time = 0.85, size = 860, normalized size = 15.93 \begin {gather*} -\frac {{\left (4 \, {\left (5 \, \sin \left (7 \, x\right ) - 3 \, \sin \left (5 \, x\right ) + 3 \, \sin \left (3 \, x\right ) - 5 \, \sin \left (x\right )\right )} \cos \left (8 \, x\right ) - 40 \, {\left (2 \, \sin \left (6 \, x\right ) + 3 \, \sin \left (4 \, x\right ) + 2 \, \sin \left (2 \, x\right )\right )} \cos \left (7 \, x\right ) - 16 \, {\left (3 \, \sin \left (5 \, x\right ) - 3 \, \sin \left (3 \, x\right ) + 5 \, \sin \left (x\right )\right )} \cos \left (6 \, x\right ) + 24 \, {\left (3 \, \sin \left (4 \, x\right ) + 2 \, \sin \left (2 \, x\right )\right )} \cos \left (5 \, x\right ) + 24 \, {\left (3 \, \sin \left (3 \, x\right ) - 5 \, \sin \left (x\right )\right )} \cos \left (4 \, x\right ) - 3 \, {\left (2 \, {\left (4 \, \cos \left (6 \, x\right ) + 6 \, \cos \left (4 \, x\right ) + 4 \, \cos \left (2 \, x\right ) + 1\right )} \cos \left (8 \, x\right ) + \cos \left (8 \, x\right )^{2} + 8 \, {\left (6 \, \cos \left (4 \, x\right ) + 4 \, \cos \left (2 \, x\right ) + 1\right )} \cos \left (6 \, x\right ) + 16 \, \cos \left (6 \, x\right )^{2} + 12 \, {\left (4 \, \cos \left (2 \, x\right ) + 1\right )} \cos \left (4 \, x\right ) + 36 \, \cos \left (4 \, x\right )^{2} + 16 \, \cos \left (2 \, x\right )^{2} + 4 \, {\left (2 \, \sin \left (6 \, x\right ) + 3 \, \sin \left (4 \, x\right ) + 2 \, \sin \left (2 \, x\right )\right )} \sin \left (8 \, x\right ) + \sin \left (8 \, x\right )^{2} + 16 \, {\left (3 \, \sin \left (4 \, x\right ) + 2 \, \sin \left (2 \, x\right )\right )} \sin \left (6 \, x\right ) + 16 \, \sin \left (6 \, x\right )^{2} + 36 \, \sin \left (4 \, x\right )^{2} + 48 \, \sin \left (4 \, x\right ) \sin \left (2 \, x\right ) + 16 \, \sin \left (2 \, x\right )^{2} + 8 \, \cos \left (2 \, x\right ) + 1\right )} \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} + 2 \, \sin \left (x\right ) + 1\right ) + 3 \, {\left (2 \, {\left (4 \, \cos \left (6 \, x\right ) + 6 \, \cos \left (4 \, x\right ) + 4 \, \cos \left (2 \, x\right ) + 1\right )} \cos \left (8 \, x\right ) + \cos \left (8 \, x\right )^{2} + 8 \, {\left (6 \, \cos \left (4 \, x\right ) + 4 \, \cos \left (2 \, x\right ) + 1\right )} \cos \left (6 \, x\right ) + 16 \, \cos \left (6 \, x\right )^{2} + 12 \, {\left (4 \, \cos \left (2 \, x\right ) + 1\right )} \cos \left (4 \, x\right ) + 36 \, \cos \left (4 \, x\right )^{2} + 16 \, \cos \left (2 \, x\right )^{2} + 4 \, {\left (2 \, \sin \left (6 \, x\right ) + 3 \, \sin \left (4 \, x\right ) + 2 \, \sin \left (2 \, x\right )\right )} \sin \left (8 \, x\right ) + \sin \left (8 \, x\right )^{2} + 16 \, {\left (3 \, \sin \left (4 \, x\right ) + 2 \, \sin \left (2 \, x\right )\right )} \sin \left (6 \, x\right ) + 16 \, \sin \left (6 \, x\right )^{2} + 36 \, \sin \left (4 \, x\right )^{2} + 48 \, \sin \left (4 \, x\right ) \sin \left (2 \, x\right ) + 16 \, \sin \left (2 \, x\right )^{2} + 8 \, \cos \left (2 \, x\right ) + 1\right )} \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \sin \left (x\right ) + 1\right ) - 4 \, {\left (5 \, \cos \left (7 \, x\right ) - 3 \, \cos \left (5 \, x\right ) + 3 \, \cos \left (3 \, x\right ) - 5 \, \cos \left (x\right )\right )} \sin \left (8 \, x\right ) + 20 \, {\left (4 \, \cos \left (6 \, x\right ) + 6 \, \cos \left (4 \, x\right ) + 4 \, \cos \left (2 \, x\right ) + 1\right )} \sin \left (7 \, x\right ) + 16 \, {\left (3 \, \cos \left (5 \, x\right ) - 3 \, \cos \left (3 \, x\right ) + 5 \, \cos \left (x\right )\right )} \sin \left (6 \, x\right ) - 12 \, {\left (6 \, \cos \left (4 \, x\right ) + 4 \, \cos \left (2 \, x\right ) + 1\right )} \sin \left (5 \, x\right ) - 24 \, {\left (3 \, \cos \left (3 \, x\right ) - 5 \, \cos \left (x\right )\right )} \sin \left (4 \, x\right ) + 12 \, {\left (4 \, \cos \left (2 \, x\right ) + 1\right )} \sin \left (3 \, x\right ) - 48 \, \cos \left (3 \, x\right ) \sin \left (2 \, x\right ) + 80 \, \cos \left (x\right ) \sin \left (2 \, x\right ) - 80 \, \cos \left (2 \, x\right ) \sin \left (x\right ) - 20 \, \sin \left (x\right )\right )} \sqrt {a}}{16 \, {\left (2 \, {\left (4 \, \cos \left (6 \, x\right ) + 6 \, \cos \left (4 \, x\right ) + 4 \, \cos \left (2 \, x\right ) + 1\right )} \cos \left (8 \, x\right ) + \cos \left (8 \, x\right )^{2} + 8 \, {\left (6 \, \cos \left (4 \, x\right ) + 4 \, \cos \left (2 \, x\right ) + 1\right )} \cos \left (6 \, x\right ) + 16 \, \cos \left (6 \, x\right )^{2} + 12 \, {\left (4 \, \cos \left (2 \, x\right ) + 1\right )} \cos \left (4 \, x\right ) + 36 \, \cos \left (4 \, x\right )^{2} + 16 \, \cos \left (2 \, x\right )^{2} + 4 \, {\left (2 \, \sin \left (6 \, x\right ) + 3 \, \sin \left (4 \, x\right ) + 2 \, \sin \left (2 \, x\right )\right )} \sin \left (8 \, x\right ) + \sin \left (8 \, x\right )^{2} + 16 \, {\left (3 \, \sin \left (4 \, x\right ) + 2 \, \sin \left (2 \, x\right )\right )} \sin \left (6 \, x\right ) + 16 \, \sin \left (6 \, x\right )^{2} + 36 \, \sin \left (4 \, x\right )^{2} + 48 \, \sin \left (4 \, x\right ) \sin \left (2 \, x\right ) + 16 \, \sin \left (2 \, x\right )^{2} + 8 \, \cos \left (2 \, x\right ) + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 4.79, size = 56, normalized size = 1.04 \begin {gather*} \frac {1}{8} \, \sqrt {a \tan \left (x\right )^{2} + a} {\left (2 \, \tan \left (x\right )^{3} - 3 \, \tan \left (x\right )\right )} + \frac {3}{16} \, \sqrt {a} \log \left (2 \, a \tan \left (x\right )^{2} + 2 \, \sqrt {a \tan \left (x\right )^{2} + a} \sqrt {a} \tan \left (x\right ) + a\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {a \left (\tan ^{2}{\left (x \right )} + 1\right )} \tan ^{4}{\left (x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.44, size = 48, normalized size = 0.89 \begin {gather*} \frac {1}{8} \, \sqrt {a \tan \left (x\right )^{2} + a} {\left (2 \, \tan \left (x\right )^{2} - 3\right )} \tan \left (x\right ) - \frac {3}{8} \, \sqrt {a} \log \left ({\left | -\sqrt {a} \tan \left (x\right ) + \sqrt {a \tan \left (x\right )^{2} + a} \right |}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int {\mathrm {tan}\left (x\right )}^4\,\sqrt {a\,{\mathrm {tan}\left (x\right )}^2+a} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________